﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Threading;
using CLFramework.Utility;

namespace StockMonitor
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            log4net.Config.XmlConfigurator.Configure();
            Application.Run(new frmLogin());
        }

        // Methods
        private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
        {
            MessageBox.Show("系统发生未知错误，错误名称：" + e.Exception.Message);
            Log.Exception(e.Exception, "系统发生未知错误");
        }

        private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            MessageBox.Show("系统发生未知错误，错误名称：" + (e.ExceptionObject as Exception).Message);
            Log.Exception(e.ExceptionObject as Exception, "系统发生未知错误");
        }
    }
}
